package Eyjafjalla.power;

import Eyjafjalla.action.ExhaustPileAction;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.megacrit.cardcrawl.actions.common.ReducePowerAction;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.helpers.ImageMaster;
import com.megacrit.cardcrawl.localization.PowerStrings;

public class PrepareDiscardPower extends AbstractEyjafjallaPower {
    public static final String POWER_ID = "eyjafjalla:PrepareDiscardPower";
    private static final PowerStrings powerStrings;

    public PrepareDiscardPower(AbstractCreature owner, int amount){
        this.name = powerStrings.NAME;
        this.ID = POWER_ID;
        this.owner = owner;
        this.amount = amount;
        this.enableExtraString = true;
        extraString = powerStrings.DESCRIPTIONS[2];
        this.updateDescription();
        String path128 = "EyjafjallaResources/img/power/PreparePower_84.png";
        String path48 = "EyjafjallaResources/img/power/PreparePower_32.png";
        this.region128 = new TextureAtlas.AtlasRegion(ImageMaster.loadImage(path128),0,0,84,84);
        this.region48 = new TextureAtlas.AtlasRegion(ImageMaster.loadImage(path48),0,0,32,32);
        this.isTurnBased = true;
        this.type = PowerType.BUFF;
    }

    @Override
    public void atStartOfTurn() {
        this.flash();
        addToBot(new ExhaustPileAction(false,3));
        addToBot(new ReducePowerAction(owner,owner,this,1));
    }

    @Override
    public void updateDescription() {
        this.description = powerStrings.DESCRIPTIONS[0] + this.amount + powerStrings.DESCRIPTIONS[1];
    }

    static {
        powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
    }
}



